<?php

namespace IMT\EventBundle\Repository;

use Doctrine\ORM\EntityRepository;

class EventBaseRepository extends EntityRepository {

    public function findEventsByDateInterval(\DateTime $dateStart, \DateTime $dateEnd) {
        $query = $this->createQueryBuilder('e')
		    ->where('e.date >= :dateStart AND e.dateEnd <= :dateEnd')
		    ->setParameter('dateStart', $dateStart)
		    ->setParameter('dateEnd', $dateEnd)
		    ->getQuery();
        
       return $query->getResult();
	}
	
}

?>